﻿@using kxcxw.Data.Common
@*<ul class="area">
    <li class="label">区域：</li><li class="current"><a href="#">全部</a></li><li><a href="#">
        东城</a></li><li><a href="#">西城</a></li><li><a href="#">海淀</a></li><li><a href="#">朝阳</a></li><li>
            <a href="#">昌平</a></li><li><a href="#">丰台</a></li></ul>*@
<ul class="arae">
    <li class="label">价格：</li>
    <li class='@(Request.QueryString["p"]==null||Request.QueryString["p"].ToString()=="all"?"current":"")'><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "p", "all")">全部</a></li>
    @{
        double HighestPrice = Convert.ToDouble(ViewData["highestPrice"]);
        CommonRepositories cr = new CommonRepositories();
        long MiddleNum = cr.getMiddleNumByHightestPrice(HighestPrice);
        long Price = 0;
        while (Price < HighestPrice)
        {
            long minPrice = Price == 0 ? 1 : Price;
            Price += MiddleNum;
            long maxPrice = Price - 1;
            string pricevalue = string.Format("{0}-{1}", minPrice.ToString(), (maxPrice + MiddleNum) > HighestPrice ? "" : maxPrice.ToString());

            string NewUrl = CommonRepositories.UrlReplace(Request.Url.ToString(), "p", pricevalue);
        <li class="@(Request.QueryString["p"] != null && Request.QueryString["p"].ToString() == pricevalue ? "current" : "")"><a href="@NewUrl">@string.Format("{0}{1}", minPrice.ToString(), (maxPrice + MiddleNum) > HighestPrice ? "以上" : "-" + maxPrice.ToString())</a></li>
        }
    }
</ul>
<ul>
    <li class="label">折扣：</li>
    <li class='@(Request.QueryString["d"]==null||Request.QueryString["d"].ToString()=="all"?"current":"")'><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "all")">全部</a></li>
    <li class="@(Request.QueryString["d"] != null && Request.QueryString["d"].ToString() == "1-3" ? "current" : "")"><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "1-3")">1-3折</a></li>
    <li class="@(Request.QueryString["d"] != null && Request.QueryString["d"].ToString() == "4-6" ? "current" : "")"><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "4-6")">4-6折</a></li>
    <li class="@(Request.QueryString["d"] != null && Request.QueryString["d"].ToString() == "7" ? "current" : "")"><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "7")">7折</a></li>
    <li class="@(Request.QueryString["d"] != null && Request.QueryString["d"].ToString() == "8" ? "current" : "")"><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "8")">8折</a></li>
    <li class="@(Request.QueryString["d"] != null && Request.QueryString["d"].ToString() == "9" ? "current" : "")"><a href="@CommonRepositories.UrlReplace(Request.Url.ToString(), "d", "9")">9折</a></li>
</ul>
